function main = MolCol(main)
% This function assigns a colour to an element, and stores that colour in
% main.colour. Main is used to retrieve and store the colour to the atom
% which it belongs to.
%%
for k = 1:length(main)
    switch main(k).element
        case '.', main(k).colour = 'k'; %We want this one hidden.
        case 'H', main(k).colour = 'w'; %H becomes White
        case 'O', main(k).colour = 'r'; %O becomes red
        case 'Cl', main(k).colour = 'g'; %Cl becomes green
        case 'F', main(k).colour = 'c'; %F becomes cyan
        case 'I', main(k).colour =  [0.5804 0 0.8275]; %I becomes purple
        case 'N', main(k).colour = 'b'; %N becomes blue
        case 'C', main(k).colour = [0.5 0.5 0.5]; %C becomes grey
        case 'S', main(k).colour = 'y'; %S becomes yellow
        case 'P', main(k).colour = [1 0.27 0]; %P becomes orange
        otherwise, main(k).colour = [0.69 0.188 0.377]; %and everything else maroon.
    end
end
end
            	